package com.csjung.games.gamenori.client.ioc;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.place.shared.PlaceHistoryHandler;
import com.google.gwt.storage.client.Storage;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;

import com.csjung.games.gaerequest.client.GaeAuthRequestTransport;
import com.csjung.games.gamenori.client.DesktopApp;
import com.csjung.games.gamenori.client.GamenoriShell;
import com.csjung.games.gamenori.client.MainApp;
import com.csjung.games.gamenori.client.activity.AppActivityMapper;
import com.csjung.games.gamenori.client.activity.AppPlaceHistoryMapper;
import com.csjung.games.gamenori.client.desktop.DesktopWelcomeView;
import com.csjung.games.gamenori.client.presenter.WelcomePresenter;
import com.csjung.games.gamenori.client.presenter.WelcomeView;
import com.csjung.games.gamenori.shared.GamenoriRequestFactory;

public class AppClientModule extends AbstractGinModule {

  @Override
  protected void configure() {
    bind(MainApp.class).to(DesktopApp.class).in(Singleton.class);
    bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
    bind(PlaceController.class).toProvider(PlaceControllerProvider.class).in(Singleton.class);
    
    bind(GaeAuthRequestTransport.class).toProvider(GaeAuthRequestTransportProvider.class).in(Singleton.class);
    
    bind(GamenoriRequestFactory.class).toProvider(RequestFactoryProvider.class).in(Singleton.class);
    
    bind(AppPlaceHistoryMapper.class).toProvider(AppPlaceHistoryMapperProvider.class).in(Singleton.class);
    bind(PlaceHistoryHandler.class).toProvider(PlaceHistoryHandlerProvider.class).in(Singleton.class);
    bind(Storage.class).toProvider(StorageProvider.class).in(Singleton.class);
    
    bind(GamenoriShell.class).toProvider(GamenoriShellProvider.class).in(Singleton.class);
    
    bind(WelcomeView.class).to(DesktopWelcomeView.class).in(Singleton.class);
    
    bind(WelcomePresenter.class).toProvider(WelcomePresenterProvider.class).in(Singleton.class);
    bind(AppActivityMapper.class).toProvider(AppActivityMapperProvider.class).in(Singleton.class);
    
  }
  
  

}
